August 12th, 2015
library(pitchRx) # returns a list of related tables (see diagram below) dat <- scrape(start = "2008-01-01", end = Sys.Date())
db <- dplyr::src_sqlite("pitchRx.sqlite3", create = TRUE)
pitchRx::scrape(start = "2008-01-01", end = Sys.Date(), connect = db$con)
update_db(db$con)
Player/date info recorded on the at-bat level.
library(dplyr)
atbats <- tbl(db, 'atbat') %>%
filter(pitcher_name == 'Yu Darvish', batter_name == 'Albert Pujols',
date == '2013_04_24')
tbl(db, 'pitch') %>%
inner_join(atbats, by = c('num', 'gameday_link')) %>%
collect() %>% pitchRx::animateFX()
https://baseballwithr.wordpress.com/2014/10/23/a-probabilistic-model-for-interpreting-strike-zone-expansion-7/ https://baseballwithr.wordpress.com/2014/11/11/interactive-visualization-of-strike-zone-expansion-5/